/**
 * 报表设计公司(2011)
 */
package net.abbp.report.designer.action.file;

import java.awt.event.ActionEvent;

import net.abbp.swing.util.ImageUtils;

import com.reportgear.designer.action.ReportAction;

/**
 * 打开报表
 * 
 * @version 1.0 2011-3-24
 * @author <a herf="lexloo@gmail.com">lexloo</a>
 * @since ANNCSR 2.0
 */
public class OpenReportAction extends ReportAction {

    public OpenReportAction() {
        setName("打开报表");
        setSmallIcon(ImageUtils.readIcon("file/open.png"));
    }

    public void actionPerformed(ActionEvent evt) {
        // ReportModel rm = this.getGridView().getReportModel();
        // JSObject jso = AppletSettings.INSTANCE.getJsObject();
        // if (jso != null) {
        // String xml = (String) jso.call("GetTemplateById", new String[] { "1"
        // });
        // // rm.fromXmlString(xml);
        //
        // this.getGridView().refresh();
        // }

        // try {
        // FileInputStream fis = new FileInputStream("c:\\report.xml");
        // ReportModel rm = JaxbUtils.inputStream2Obj(ReportModel.class, fis);
        //            
        // this.getGridView().setReportModel(rm);
        // this.getGridView().refresh();
        // fis.close();
        // } catch (FileNotFoundException e1) {
        // e1.printStackTrace();
        // } catch (IOException e2) {
        // e2.printStackTrace();
        // }

    }
}
